package com.bsi.core.aspect;

import lombok.Data;
import org.springframework.aop.support.AopUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.ClassUtils;

/**
 * @ClassName AspectJConfiguration
 * @Author LiuSong
 * @Date 2020/7/31 10:08
 * @Version 1.0
 * @Description
 */
@ConditionalOnBean({AspectJMarkerConfiguration.Marker.class})
@EnableConfigurationProperties(AspectJLogProperties.class)
public class AspectJAutoConfiguration {
    @Bean
    @ConditionalOnProperty(prefix = "aspect", name = "isOpen", havingValue = "true")
    public WebLogAspect webLogAspect() {
        return new WebLogAspect();
    }
}
